<cfprocessingdirective suppresswhitespace="yes">
<!--- 
***** REVISION *****
10/18/06: This is a new tag
 --->
 	
<cfswitch expression="#thisTag.executionMode#">
	<cfcase value="start">
		<cfset tag = "text"/>

		<cfsavecontent variable="attributeCombination">
		<strong>Available Attributes are:</strong>
		<LI>Required attributes: NAME or ID or VALUE or FORLABEL.</LI>
		<LI>Optional attributes: LABEL, CLASSLABEL, BREAK, CSS.</LI>
		</cfsavecontent>
		
		<cfinclude template="inc/start.cfm"/>
		
		<cfset excludes = parent.excludes & ",value"/>
				
		<!--- Process NAME attribute --->
		<cfif not structKeyExists(attributes,'name')>
			<cfif structKeyExists(attributes, 'id')>
				<cfset parent.setValue('id','name',attributes)/>
			<cfelseif structKeyExists(config, 'value')>
				<cfset config.value = parent.setValue('value','name',config,attributes)/>
			<cfelseif structKeyExists(config, 'forLabel')>
				<cfset parent.setValue('forLabel','name',config,attributes)/>
			<cfelseif isDefined("request.ui.form.#tag#.html") and structKeyExists(request.ui.form[tag].html,'name')>
				<cfset attributes.name = request.ui.form[tag].html.name/>
			</cfif>
			<cfif not structKeyExists(attributes, 'name')>
				<cfset parent.showException(tag,'You must specify at least one attribute of NAME, ID, VALUE, or FORLABEL.',3,attributeCombination)/>
			</cfif>
		</cfif>
		<cfparam name="config.value" default="#parent.setValue('name','',attributes)#"/>

		<!--- *** CONFIG VARIABLES *** --->
		<cfset structAppend(config,parent.getConfig(tag,attributes,request,parent),false)/>
		
		<!--- *** HTML VARIABLES *** --->
		<cfset attributes = parent.getHtml(tag,attributes,request)/>

		<cfparam name="attributes.id" default="#attributes.name#"/>
		<cfparam name="config.forLabel" default="#attributes.id#"/>		
		<cfif not structKeyExists(config,'label')>
			<cfset config.label = trim(replaceList(attributes.name,'_,nm,id,cd,txt',' ,Name,,,'))/>
		</cfif>
		<cfif config.css>
			<cfset parent.config.cssLabelCode = true/>
			<cfparam name="config.classLabel" default="label"/>
			<cfparam name="attributes.class" default="text"/>
		</cfif>		
		<cfif config.css and not structKeyExists(parent.config.cssCode,'text')>
			<cfset parent.config.cssCode.text=".text{margin-bottom:3px;margin-left:120px;width:240px;border-bottom:##ece9d8 1px solid;}"/>
		</cfif>
		
		<!--- process VALUE --->
		<cfset config.value = parent.processValue(config.value,caller,attributes,config)/>
	</cfcase>	
	
	<cfcase value="end">
		<cfinclude template="inc/field.cfm"/>
	</cfcase>
</cfswitch>
</cfprocessingdirective>